package com.toobigtofail.placeholders
{
	import fabulaexmachina.box2fp.Box2DEntity;
	
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.utils.Input;
	import net.flashpunk.utils.Key;
	
	public class Placeholder extends Entity
	{
		protected var _isLocked:Boolean = false;
		
		public function Placeholder(x:Number=0, y:Number=0) {}
		public function getBox2DEntity():Box2DEntity { return null; };
		
		override public function update():void {
			super.update();
			
			var angleChange:Number = 0;
			if (Input.check(Key.A)) {
				angleChange = -1;
			}
			else if (Input.check(Key.D)) {
				angleChange = 1;
			}
			
			if (!_isLocked && angleChange) {
				var img:Image = (graphic as Image);
				img.angle += angleChange;
				img.centerOrigin();
			}
		}
		
		public function centerOnMouse(mX:Number, mY:Number):void {
			x = mX - width/2;
			y = mY - height/2;
		}
		
		public function get locked():Boolean { return _isLocked; }
		public function set locked(l:Boolean):void { _isLocked = l; }
	}
}